Optimal. Leaf size=70 \[ \frac {c^2 x}{a^2}-\frac {2 a c^2 \cos ^3(e+f x)}{3 f (a+a \sin (e+f x))^3}+\frac {2 c^2 \cos (e+f x)}{f \left (a^2+a^2 \sin (e+f x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 70, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {2815, 2759, 8}
\begin {gather*} \frac {2 c^2 \cos (e+f x)}{f \left (a^2 \sin (e+f x)+a^2\right )}+\frac {c^2 x}{a^2}-\frac {2 a c^2 \cos ^3(e+f x)}{3 f (a \sin (e+f x)+a)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2759
Rule 2815
Rubi steps
\begin {align*} \int \frac {(c-c \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx &=\left (a^2 c^2\right ) \int \frac {\cos ^4(e+f x)}{(a+a \sin (e+f x))^4} \, dx\\ &=-\frac {2 a c^2 \cos ^3(e+f x)}{3 f (a+a \sin (e+f x))^3}-c^2 \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^2} \, dx\\ &=-\frac {2 a c^2 \cos ^3(e+f x)}{3 f (a+a \sin (e+f x))^3}+\frac {2 c^2 \cos (e+f x)}{f \left (a^2+a^2 \sin (e+f x)\right )}+\frac {c^2 \int 1 \, dx}{a^2}\\ &=\frac {c^2 x}{a^2}-\frac {2 a c^2 \cos ^3(e+f x)}{3 f (a+a \sin (e+f x))^3}+\frac {2 c^2 \cos (e+f x)}{f \left (a^2+a^2 \sin (e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.40, size = 119, normalized size = 1.70 \begin {gather*} \frac {c^2 \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (3 (-8+3 e+3 f x) \cos \left (\frac {1}{2} (e+f x)\right )+(16-3 e-3 f x) \cos \left (\frac {3}{2} (e+f x)\right )+6 (2 (-2+e+f x)+(e+f x) \cos (e+f x)) \sin \left (\frac {1}{2} (e+f x)\right )\right )}{6 a^2 f (1+\sin (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.29, size = 53, normalized size = 0.76
method | result | size |
derivativedivides | \(\frac {2 c^{2} \left (\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {8}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {4}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}\right )}{f \,a^{2}}\) | \(53\) |
default | \(\frac {2 c^{2} \left (\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {8}{3 \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {4}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}\right )}{f \,a^{2}}\) | \(53\) |
risch | \(\frac {c^{2} x}{a^{2}}+\frac {8 i c^{2} {\mathrm e}^{i \left (f x +e \right )}+8 c^{2} {\mathrm e}^{2 i \left (f x +e \right )}-\frac {16 c^{2}}{3}}{f \,a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )^{3}}\) | \(67\) |
norman | \(\frac {\frac {c^{2} x}{a}+\frac {c^{2} x \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {8 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}+\frac {8 c^{2} \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}+\frac {16 c^{2} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}+\frac {8 c^{2}}{3 a f}+\frac {3 c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a}+\frac {5 c^{2} x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {7 c^{2} x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {7 c^{2} x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {5 c^{2} x \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {3 c^{2} x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {16 c^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 a f}+\frac {8 c^{2} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 a f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2} a \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}\) | \(298\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 391 vs.
\(2 (72) = 144\).
time = 0.52, size = 391, normalized size = 5.59 \begin {gather*} \frac {2 \, {\left (c^{2} {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 4}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {3 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} - \frac {c^{2} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 2\right )}}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {2 \, c^{2} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}\right )}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 166 vs.
\(2 (72) = 144\).
time = 0.32, size = 166, normalized size = 2.37 \begin {gather*} -\frac {6 \, c^{2} f x - {\left (3 \, c^{2} f x - 8 \, c^{2}\right )} \cos \left (f x + e\right )^{2} - 4 \, c^{2} + {\left (3 \, c^{2} f x + 4 \, c^{2}\right )} \cos \left (f x + e\right ) + {\left (6 \, c^{2} f x + 4 \, c^{2} + {\left (3 \, c^{2} f x + 8 \, c^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{3 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f \cos \left (f x + e\right ) - 2 \, a^{2} f - {\left (a^{2} f \cos \left (f x + e\right ) + 2 \, a^{2} f\right )} \sin \left (f x + e\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 473 vs.
\(2 (65) = 130\).
time = 2.40, size = 473, normalized size = 6.76 \begin {gather*} \begin {cases} \frac {3 c^{2} f x \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{3 a^{2} f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 3 a^{2} f} + \frac {9 c^{2} f x \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{3 a^{2} f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 3 a^{2} f} + \frac {9 c^{2} f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{3 a^{2} f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 3 a^{2} f} + \frac {3 c^{2} f x}{3 a^{2} f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 3 a^{2} f} + \frac {24 c^{2} \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{3 a^{2} f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 3 a^{2} f} + \frac {8 c^{2}}{3 a^{2} f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + 9 a^{2} f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 3 a^{2} f} & \text {for}\: f \neq 0 \\\frac {x \left (- c \sin {\left (e \right )} + c\right )^{2}}{\left (a \sin {\left (e \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 58, normalized size = 0.83 \begin {gather*} \frac {\frac {3 \, {\left (f x + e\right )} c^{2}}{a^{2}} + \frac {8 \, {\left (3 \, c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c^{2}\right )}}{a^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{3}}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.07, size = 89, normalized size = 1.27 \begin {gather*} \frac {c^2\,x}{a^2}-\frac {c^2\,\left (e+f\,x\right )+\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (3\,c^2\,\left (e+f\,x\right )-\frac {c^2\,\left (9\,e+9\,f\,x+24\right )}{3}\right )-\frac {c^2\,\left (3\,e+3\,f\,x+8\right )}{3}}{a^2\,f\,{\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+1\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________